package org.secangkirkopipanas.gxtcore.server.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import net.sf.hibernate4gwt.pojo.java5.LazyPojo;

import org.secangkirkopipanas.gxtcore.domain.ISystemApplication;
import org.secangkirkopipanas.gxtcore.domain.ISystemApplicationTask;

@Entity
@Table(name = "sys_app_task")
public class SystemApplicationTask extends LazyPojo implements Serializable,
		ISystemApplicationTask {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "id", nullable = false, insertable = true, updatable = true)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	@Column(name = "task_name", length = 50, nullable = false, insertable = true, updatable = true)
	private String name;

	@ManyToOne(targetEntity = SystemApplication.class)
	@JoinColumn(referencedColumnName = "id", nullable = false)
	private ISystemApplication application;

	@Column(name = "is_menu", nullable = false, insertable = true, updatable = true)
	private boolean menuTask = false;

	@Column(name = "category_name", length = 50, nullable = false, insertable = true, updatable = true)
	private String categoryName;

	public SystemApplicationTask() {
	}

	public SystemApplicationTask(Long id, String name,
			SystemApplication application, String categoryName, boolean menuTask) {
		this.id = id;
		this.name = name;
		this.application = application;
		this.menuTask = menuTask;
		this.categoryName = categoryName;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ISystemApplication getApplication() {
		return application;
	}

	public void setApplication(ISystemApplication application) {
		this.application = application;
	}

	public boolean isMenuTask() {
		return menuTask;
	}

	public void setMenuTask(boolean menuTask) {
		this.menuTask = menuTask;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

}
